package com.heny.demo.dbutils;
/**
 * @author litao.cc
 * @version DynamicTableContext.java v0.1 t2025/5/5 19:59
 * @date 2025/5/5 19:59
 * @description DynamicTableContext
 */
public class DynamicTableContext {
    private static final ThreadLocal<String> TABLE_NAME = new ThreadLocal<>();
    public static void setTableName(DynamicTableProcessorEnum t, DynamicTableModel p) {
        String tableName = t.getProcessor().getTableName(p);
        TABLE_NAME.set(tableName);
    }

    public static String getTableName() {
        return TABLE_NAME.get();
    }

    public static void clear() {
        TABLE_NAME.remove();
    }
}